<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta name="page-view-size" content="1280*720" />
    <link rel="stylesheet" href="style/base.css" />
    <title>熊猫部落-专题</title>
    <style>
      body {
        position: absolute;
        margin: 0;
        padding: 0;
        width: 1280px;
        height: 720px;
        background-repeat: no-repeat;
        background-color: transparent;
        overflow: hidden;
      }
      #subject .container,
      #subject .item{
        position: absolute;
      }

      #subject .active {
        display: none;
      }
      #subject .focus{
        border: none !important;
        transform: scale(1);
        margin: 0;
      }
      #subject .focus .default {
        display: none;
      }
      #subject .focus .active {
        display: block;
      }
      #subject img{
        display: block;
        width: 100%;
        height: 100%;
      }
    </style>
  </head>
  <body onload="init()">
    <div id="main">
	<!--联通不要 -->
      <div class='smallResolution' id="smallResolution"></div>
	  <!--联通不要 -->
      <div id="subject"></div>
    </div>
    <script src="js/jquery.js"></script>
    <script src="config/index.js"></script>
    <script src="api/index.js"></script>
    <script src="js/utlis.js"></script>
    <script src="js/KeyEnter.js"></script>
    <script src="js/event.js"></script>
    <script src="js/move.js"></script>
    <script src="js/log.js"></script>
    <script src="js/page.js"></script>

    <script src="components/dialog.js"></script>
    <script src="components/subject.js"></script>
    <script>
      function getPreFocus() {
        var typeId = utils.getUrlParam("typeId", "")
        var elId = utils.getUrlParam("elId", "")
        var typeName = unescape(utils.getUrlParam('typeName', ''))
        page.init()
        subject.init({
          typeId: typeId
        })
        var dom = document.getElementById(elId || "subject-0")
        dom && utils.toggleClass(dom)
        log.commit({
          name: '熊猫专题页面',
          type1: 'browse',
          type2: 'subject',
          starttime: new Date().getTime(),
        })
      }

      function init () {
        getPreFocus()
      }

      function keyUp () {
        if (!dialog.visible) {
          var dom = move.up();
          dom && utils.toggleClass(dom);
        }
      }

      function keyDown () {
        if (!dialog.visible) {
          var dom = move.down();
          console.log(dom)
          dom && utils.toggleClass(dom);
        }
      }

      function keyLeft () {
        if (!dialog.visible) {
          var dom = move.left();
          dom && utils.toggleClass(dom);
        }
      }

      function keyRight () {
        if (!dialog.visible) {
          var dom = move.right();
          dom && utils.toggleClass(dom);
        }
      }

      function keyBack () {
        if (dialog.visible) {
          dialog.hide()
        } else {
          page.goback()
        }
      }

      function keyEnter () {
        if (dialog.visible) {
          dialog.hide()
        } else {
          var info = utils.getCurInfo()
          var data = page.data.subject
          if (!data.length) return
          var cur = data[info.index]
          var typeId = subject.typeId
          // var to = config.path + 'vod.html?'
          // var program = subject.picList
          var form = config.path + '/subject.html?typeId=' + typeId + '&elId=' + info.id
          var to = config.path + "/vod.html?seriesId=" + cur.picList.ID
          page.addUrl(to, form)
          // console.log(subject)

          // page.goback()
        }
      }
    </script>
  </body>
</html>
